/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package lu.med.praxiswahl.wahlumed.model.beans;

import java.io.Serializable;
import java.util.Calendar;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;

/**
 * 
 * @author pkendzo
 */
@Entity
@Table(name = "PRAXIS_TERMINEN")
public class CalendarTBL implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;

	@Temporal(javax.persistence.TemporalType.DATE)
	private Calendar datum;

	private String rv_uhrzeit;
	private String ankunft_zeit;
	private String untersuchungsbeginn;
	private String wartezeit;
	private String sortie;
	private String untersuchungstyp;
	private String rv_aenderung;
	/* private boolean vorbereitet; */
	@Column(name = "NEU", nullable = true)
	private boolean newCustomer_GreenColor;

	private String hCash;
	private String hKarte;
	private String hErstellt;

	@Column(name = "LOCKED")
	private Boolean locked;

	@OneToOne
	@JoinColumn(name = "LAST_EDITOR", nullable = true)
	private AccountingTBL lastEditor;

	@Column(name = "LAST_EDITED")
	@Temporal(javax.persistence.TemporalType.TIMESTAMP)
	private Calendar lastEditTime;
	
	@ManyToOne
	@JoinColumn(name = "CUST_ID")
	private CustomerTBL customer;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Override
	public int hashCode() {
		int hash = 0;
		hash += (id != null ? id.hashCode() : 0);
		return hash;
	}

	@Override
	public boolean equals(Object object) {
		// TODO: Warning - this method won't work in the case the id fields are
		// not set
		if (!(object instanceof CalendarTBL)) {
			return false;
		}
		CalendarTBL other = (CalendarTBL) object;
		if ((this.id == null && other.id != null)
				|| (this.id != null && !this.id.equals(other.id))) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		return "lu.med.praxiswahl.wahlumed.model.beans.CalendarTBL[id=" + id
				+ "]";
	}

	public String getAnkunft_zeit() {
		return ankunft_zeit;
	}

	public void setAnkunft_zeit(String ankunft_zeit) {
		this.ankunft_zeit = ankunft_zeit;
	}

	public String getRv_aenderung() {
		return rv_aenderung;
	}

	public void setRv_aenderung(String rv_aenderung) {
		this.rv_aenderung = rv_aenderung;
	}

	public String getRv_uhrzeit() {
		return rv_uhrzeit;
	}

	public void setRv_uhrzeit(String rv_uhrzeit) {
		this.rv_uhrzeit = rv_uhrzeit;
	}

	public Calendar getDatum() {
		return datum;
	}

	public void setDatum(Calendar datum) {
		this.datum = datum;
	}

	public String getUntersuchungsbeginn() {
		return untersuchungsbeginn;
	}

	public void setUntersuchungsbeginn(String untersuchungsbeginn) {
		this.untersuchungsbeginn = untersuchungsbeginn;
	}

	public String getUntersuchungstyp() {
		return untersuchungstyp;
	}

	public void setUntersuchungstyp(String untersuchungstyp) {
		this.untersuchungstyp = untersuchungstyp;
	}

	/*
	 * public boolean isVorbereitet() { return vorbereitet; }
	 * 
	 * public void setVorbereitet(boolean vorbereitet) { this.vorbereitet =
	 * vorbereitet; }
	 */

	public String getWartezeit() {
		return wartezeit;
	}

	public void setWartezeit(String wartezeit) {
		this.wartezeit = wartezeit;
	}

	public CustomerTBL getCustomer() {
		return customer;
	}

	public void setCustomer(CustomerTBL customer) {
		this.customer = customer;
	}

	public String getSortie() {
		return sortie;
	}

	public void setSortie(String sortie) {
		this.sortie = sortie;
	}

	public String getHCash() {
		return hCash;
	}

	public void setHCash(String cash) {
		hCash = cash;
	}

	public String getHKarte() {
		return hKarte;
	}

	public void setHKarte(String karte) {
		hKarte = karte;
	}

	public String getHErstellt() {
		return hErstellt;
	}

	public void setHErstellt(String erstellt) {
		hErstellt = erstellt;
	}

	public boolean getNewCustomer_GreenColor() {
		return newCustomer_GreenColor;
	}

	public void setNewCustomer_GreenColor(boolean newCustomer_GreenColor) {
		this.newCustomer_GreenColor = newCustomer_GreenColor;
	}

	public Boolean getLocked() {
		return locked;
	}

	public void setLocked(Boolean locked) {
		this.locked = locked;
	}

	public AccountingTBL getLastEditor() {
		return lastEditor;
	}

	public void setLastEditor(AccountingTBL lastEditor) {
		this.lastEditor = lastEditor;
	}

	public Calendar getLastEditTime() {
		return lastEditTime;
	}

	public void setLastEditTime(Calendar lastEditTime) {
		this.lastEditTime = lastEditTime;
	}

}
